<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class UserAccountRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
       return  [
            'nickName' => 'required|regex:/^\w{6,20}$/',
            'sex'=>'required',
            'star'=>'required',
            'birth'=>'required',
            'prov'=>'required',
            'city'=>'required',
            'sign'=>'required|max:300|min:4',
            'email' => 'email|email'

        ];
    }
     public function messages()
    {
        return [
            'nickName.required'=>'对不起昵称必填',
            'nickName.regex'=>'昵称格式不正确',
            // 'nickName.unique'=>'昵称已经存在',
            'sex.required'=>'性别必选',
            'star.required'=>'星座必填',
            'birth.required'=>'生日必填',
            'prov.required'=>'省市必填',
            'city.required'=>'市必填',
            'sign.required'=>'个性签名必填',
            'sign.max'=>'个性签名过长',
            'sign.min'=>'个性签名过短',
            'email.email'=>'邮箱格式不正确'
           
        ];
      }  
}
